interface Props {
  id: string;
  title: string;
  children: number[];
}
type PartialProps = Partial<Props>;
//1 所有参数变为可选参数
let s1: Props = {
  id: "10001",
  title: "标题",
  children: [1, 2, 3],
};
let s2: PartialProps = {
  id: "10001",
  // children: [1, 2, 3],
};
//2 所有属性为只读属性
type ReadonlyProps = Readonly<Props>;
let s3: ReadonlyProps = {
  id: "10001",
  title: "标题",
  children: [1, 2, 3],
};
// s3.id = "1002";
//3 摘取所需属性
type PickProps = Pick<Props, "title" | "children">;
let s4: PickProps = {
  // id: "10001",
  title: "标题",
  children: [1, 2, 3],
};

//4 为a b c三个容器的类型为string[]
type MyRecord = Record<"a" | "b" | "c", string[]>;
let s5: MyRecord = {
  a: ["1"],
  b: ["2"],
  c: ["3"],
};
